package mlz.b_extends.demo07;

public class Person {
    private String name;
    private int age;

//    public Person() {
//        System.out.println("这是父类的无参构造方法");
//    }


    //类中如果手动添加了有参构造方法,那么系统将不再默认添加无参构造方法\
    //子类是默认调用父类中的无参构造方法

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("这是父类的有参构造方法");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
